package Tracer;

import XMLScene.RTIObject;

/**
 * ClassName : RTHitpointObjMap RTHitpointObjMap is a class which is used to
 * store the details of the hit point. One private member is the coordinate of
 * the hit point. The second is the normal of the hit point. The most important
 * is the object which ray hit on.
 * 
 * @version 1.0 Oct 6th 2009
 * @author LU LIU & PENG ZHANG
 */
public class RTHitpointObjMap {
	/**
	 * the hit point
	 */
	private RTVector hitpoint;
	/**
	 * the hit normal vector
	 */
	private RTVector hitNormal;
	/**
	 * the object for hit
	 */
	private RTIObject hitObject;

	/**
	 * Class Constructor This is a default constructor
	 */
	public RTHitpointObjMap() {
		this.hitNormal = new RTVector();
		this.hitpoint = new RTVector();
		hitObject = null;
	}

	/**
	 * Class Constructor This is a constructor to initialize the
	 * RTHitpointObjMap with the coordinate of hit point, the normal of hit
	 * point and the object which ray hit on
	 * 
	 * @param ihitPoint
	 *            the coordinate of hit point
	 * @param ihitNormal
	 *            the normal of hit point
	 * @param ihitObject
	 *            the object which ray hit on
	 */
	public RTHitpointObjMap(final RTVector ihitPoint,
			final RTVector ihitNormal, final RTIObject ihitObject) {
		this.hitpoint = new RTVector(ihitPoint);
		this.hitNormal = new RTVector(ihitNormal);
		hitObject = ihitObject;
	}

	/**
	 * Getter method of hit point vector
	 * 
	 * @return the hit point
	 */
	public final RTVector getHitPoint() {
		return hitpoint;
	}

	/**
	 * Getter method of hitNormal vector
	 * 
	 * @return the normal vector
	 */
	public final RTVector getHitNormal() {
		return hitNormal;
	}

	/**
	 * Getter method of the object of hit point
	 * 
	 * @return the hit object
	 */
	public final RTIObject getHitObject() {
		return hitObject;
	}

	/**
	 * Setter method of hitPoint vector
	 * 
	 * @param hitPoint
	 */
	public final void setHitPoint(final RTVector ihitPoint) {
		this.hitpoint = ihitPoint;
	}

	/**
	 * Setter method of hitNormal vector
	 * 
	 * @param ihitNormal
	 *            the hit normal
	 */
	public final void setHitNormal(final RTVector ihitNormal) {
		this.hitNormal = ihitNormal;
	}

	/**
	 * Setter method of hitObject
	 * 
	 * @param ihitObject
	 *            the hit object
	 */
	public final void setHitObject(final RTIObject ihitObject) {
		this.hitObject = ihitObject;
	}

}
